package com;

import com.jd.service.JDPictureService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
import com.mrobuy.jd.product.VCProductUpdate;

@SpringBootApplication
public class Application2 {
    private static Logger LOG = LoggerFactory.getLogger(JDPictureService.class);

//    public static void main(String[] args) {
////		SpringApplication.run(Application.class, args);
//        ApplicationContext ac = SpringApplication.run(Application.class, args);
//        try {
////            VCProductUpdate pu = new VCProductUpdate();
//            VCProductUpdate pu = (VCProductUpdate)ac.getBean("VCProductUpdate");
//            System.out.println("222222!");
//
//            pu.update();
//            System.out.println("Done!");
//        }catch(Exception e){
//            LOG.error(e.getMessage(), e);
//        }
//    }

//    @Bean
//    public VCProductUpdate restTemplate() {
//                try{
//
//        VCProductUpdate pu = new VCProductUpdate();
//        pu.update("100023660898");
//        System.out.println("Done!");
//        return pu;
//    }catch(Exception e){
//            System.out.println( e);
//            return null;
//        }
//    }
//
//    @Bean
//    public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
//        return args -> {
//
////			System.out.println("Let's inspect the beans provided by Spring Boot:");
//
////			String[] beanNames = ctx.getBeanDefinitionNames();
////			Arrays.sort(beanNames);
////			for (String beanName : beanNames) {
////				System.out.println(beanName + ": " + ctx.getBean(beanName).getClass().getName());
////			}
//
//        };
//    }

}
